"""mydjango URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, re_path
from django.views.static import serve
# from myapp.md_user import MyView,UpdUser
from myapp.view import Index
from myapp.md_user import RegisterView, MyCode, Login, wb_back, ding_back, UploadFile, UpdateUserAPIView, QiNiu, \
    UserInfo, Add_image, UserList
from myapp.md_pics import InserPicsView, UpdPicsView
from myapp.md_goods import InserGoods, GoodsList, GoodItem, InsertTags, GetTags, UpdGood, UpdTag, GetOnLine, InsertComment, CommentList, Page_CommentList, UidFlow, GidFlow, AddUserFlow, GoodsClick, GoodsRank, GoodsSearch

# from myapp.weeklyexam1 import NewRegisterAPIView, NewLoginAPIview, DingDingLogin, Qiniu

urlpatterns = [
    # 定义超链接路由
    re_path('^static/upload/(?P<path>.*)$', serve,{'document_root': '/static/upload/'}),
    path('reg/', RegisterView.as_view()),  # 注册路由
    path('code/', MyCode.as_view()),  # 验证码路由
    path('login/', Login.as_view()),  # 登陆接口
    path('weibo_callback/', wb_back),  # 微博回调接口
    path('dingding_callback/', ding_back),  # 钉钉回调接口
    path('uploadfile/', UploadFile.as_view()),  # 上传文件接口
    path('upd/', UpdateUserAPIView.as_view()),  # 修改用户资料
    path('qiniu/', QiNiu.as_view()),  # 七牛云返回token接口
    path('userinfo/', UserInfo.as_view()),  # 获取用户数据
    path('addimage/', Add_image.as_view()),  # 添加用户图片
    path('user_item/', UserList.as_view()),  # 用户数据查询


    path('inserpics/', InserPicsView.as_view()),  # 幻灯片图片添加
    path('updpics/', UpdPicsView.as_view()),  # 幻灯片图片修改

    path('insergoods/', InserGoods.as_view()),  # 商品添加
    path('goodslist/', GoodsList.as_view()),  # 商品列表获取
    path('gooditem/', GoodItem.as_view()),  # 商品详情获取
    path('inserttags/', InsertTags.as_view()),  # 标签添加
    path('gettags/', GetTags.as_view()),  # 标签查询
    path('updgood/', UpdGood.as_view()),  # 修改商品信息
    path('updtag/', UpdTag.as_view()),  # 修改商品标签
    path('getonline/', GetOnLine.as_view()),  # 统计在线人数
    path('insertcomment/', InsertComment.as_view()),  # 评论添加接口
    path('commentlist/', CommentList.as_view()),  # 评论展示接口
    path('pagecomment/', Page_CommentList.as_view()),  # 评论展示接口
    path('adduserflow/', AddUserFlow.as_view()),  # 添加用户收藏
    path('uidflow/', UidFlow.as_view()),  # 用户关注的商品
    path('gidflow/', GidFlow.as_view()),  # 商品关注了那些商品
    path('goodsclick/', GoodsClick.as_view()),  # 商品点击
    path('goodsrank/', GoodsRank.as_view()),  # 商品排行
    path('goodssearch/', GoodsSearch.as_view()),  # 商品排行
    


    # 考试使用的接口
    # path('newreg/', NewRegisterAPIView.as_view()),  # 考试注册接口
    # path('newlog/', NewLoginAPIview.as_view()),  # 考试注册接口
    # path('dingding_callback/', DingDingLogin),  # 钉钉回调接口
    # path('newqiniu/', Qiniu.as_view()),  # 钉钉回调接口

    # 模板接口
    # path('',MyView.as_view()),
    # path('upd/',UpdUser.as_view())
]
